#include <iostream>
#include <string>

using namespace std;

#include "Date.hpp"
#include "ArrayList.hpp"
#include "Person.hpp"

int main(int argc, char **argv)
{
    Date d(1062, 11, 2);
    cout << d.toString() << endl;

    ArrayList<int> alist;
    alist.add(1);
    alist.add(2);
    alist.add(30);
    alist.add(45);
    alist.add(59);
    alist.add(1);
    alist.add(2);
    alist.add(30);
    alist.add(45);
    alist.add(59);
    alist.add(1);
    cout << "动态数组大小为：" << alist.size() << endl;

    Date unlimited, unknown;
    unlimited.setValid(false);
    unknown.setUnknown(true);

    Person p1(string("弗拉德三世·采佩什"), kGenderMale, d, unlimited, string("穿刺公"), nullptr, nullptr);
    Person p2(string("有角 幻也"), kGenderMale, Date(1094, 1, 1), unlimited, string("特务"), nullptr, nullptr);
    Person p3(string("索妮亚·贝尔蒙多"), kGenderFemale, Date(1433, 1, 1), unknown, string("吸血鬼猎人"), nullptr, nullptr);
    Person p4(string("拉尔夫·C·贝尔蒙多"), kGenderMale, Date(1456, 1, 1), unknown, string("吸血鬼猎人"), nullptr, nullptr);
    Person p5(string("赛法·贝尔南堤斯"), kGenderFemale, unknown, unknown, string("魔法师"), nullptr, nullptr);
    
    p1.addChild(&p2);
    p2.addSpouse(&p3);
    p2.addChild(&p4, &p3);
    p4.addSpouse(&p5);
    
    cout << p1.toString() << endl;
    cout << p2.toString() << endl;
    cout << p3.toString() << endl;
    cout << p4.toString() << endl;
    cout << p5.toString() << endl;
}
